package com.example.shuiyin.config;

import org.springframework.context.annotation.Bean;
// import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

import java.util.concurrent.Executor;

/**
 * @deprecated 此配置类已被TaskExecutorConfig替代，为避免Bean冲突，此类已停用
 */
// @Configuration
// @EnableAsync
@Deprecated
public class AsyncConfig {

    // @Bean(name = "taskExecutor")
    public Executor taskExecutor() {
        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
        executor.setCorePoolSize(5);
        executor.setMaxPoolSize(10);
        executor.setQueueCapacity(100);
        executor.setThreadNamePrefix("taskExecutor-");
        executor.initialize();
        return executor;
    }
    
    // @Bean(name = "watermarkExecutor")
    public Executor watermarkExecutor() {
        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
        executor.setCorePoolSize(2);
        executor.setMaxPoolSize(4);
        executor.setQueueCapacity(50);
        executor.setThreadNamePrefix("watermark-");
        executor.initialize();
        return executor;
    }
} 